<script setup>
import { defineProps,ref,defineModel } from 'vue';
const props=defineProps({
  value:{
    type:String,
    default:''
    
  }
})
const emit=defineEmits(['editValue'])
const sonVal=ref("")
const sonText=defineModel()
</script>

<template>
  <h1>{{ value }}</h1>
  <h2 v-bind="$attrs">
    <slot></slot>
  </h2>
  <h3>
    <slot name="title"></slot>
  </h3>
  <div>
    <input type="text" v-model="sonVal">
    <button @click="emit('editValue',sonVal)">点击</button>
  </div>
  <div>
    组件的v-model：<input type="text" v-model="sonText">
  </div>
  <h6>子组件：{{ sonText }}</h6>
</template>

<style scoped>
.read-the-docs {
  color: #888;
}
.green{
  color: green;
  background-color: blue;
}
</style>
